package com.hao1st.service1.biz.rpcdemo.controller;

import com.hao1st.service1.rpc.Service2Rpc;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/rpc")
public class RpcController {

    @Resource
    private Service2Rpc service2Rpc;

    @GetMapping("/invoke")
    public String rpcService2() {
        // 调用接口访问service2
        return service2Rpc.rpcService2();
    }
}
